
#include <math.h>
#include "ka-graphics/geom.h"

using namespace ka;

const Point Point::ZERO(0.0f, 0.0f);

float Point::distTo(Point p) const {
	float dx = p.x - x;
	float dy = p.y - y;
	return sqrtf(dx*dx + dy*dy);
}

Point Point::operator/(float v) const {
	return Point(x/v, y/v);
}

Point &Point::operator+=(Point p) {
	x += p.x;
	y += p.y;
	return *this;
}

Point &Point::operator+=(float s) {
	x += s;
	y += s;
	return *this;
}

const Size Size::ZERO(0.0f, 0.0f);
